package com.lanchetech.common.enums;

import lombok.Getter;

@Getter
public enum RushBuyStatusEnum {
    // 抢购状态 0 待成团 1 抢购成功 2 抢购失败 3 已取消
    PENDING((byte) 0, "抢购中"),
    SUCCESS((byte) 1, "抢购成功"),
    FAIL((byte) 2, "抢购失败"),
    CANCEL((byte) 3, "已取消"),
    ;

    private Byte status;
    private String remark;

    RushBuyStatusEnum(Byte status, String remark) {
        this.status = status;
        this.remark = remark;
    }

    public static String getRemarkByStatus(Byte status) {
        for (RushBuyStatusEnum ordersStatus : RushBuyStatusEnum.values()) {
            if (ordersStatus.getStatus().equals(status)) {
                return ordersStatus.getRemark();
            }
        }
        return "";
    }
}
